package com.example.forum.service;

import com.example.forum.model.Message;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface IMessageService {
    //发送站内消息
    void create(Message message);

    //根据id查询站内信
    Message selectById(Long id);

    //根据用户Id查询该用户未读数量
    Integer selectUnreadCount(Long receiveUserId);

    //根据接收者用户Id查询所有站内信
    List<Message> selectByReceiveUserId(Long receiveUserId);

    //更新指定站内信的状态
    void updateStateById(Long id,Byte state);

    //回复站内信
    @Transactional
    void reply(Long repliedId,Message message);
}
